FILE(GLOB master_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
FILE(GLOB master_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
FILE(GLOB master_UI ${CMAKE_CURRENT_SOURCE_DIR}/forms/*.ui)
SET(QRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/master.qrc)
QT5_WRAP_CPP(master_MOC_out ${master_INCLUDES})
QT5_WRAP_UI(master_UIC_out ${master_UI})
QT5_ADD_RESOURCES(master_RCC_out ${QRC_FILE})
#QT4_TRANSLATIONS_FOR_QRC(${QRC_FILE} ${master_SOURCES} ${master_INCLUDES})

IF(ITALC_BUILD_WIN32)
	SET(WINRC "${CMAKE_CURRENT_BINARY_DIR}/italc-master-rc.obj")
	ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
	ADD_CUSTOM_COMMAND(OUTPUT ${WINRC}
						COMMAND ${WINDRES}
							-I${CMAKE_CURRENT_SOURCE_DIR}
							-o${WINRC}
							-i${CMAKE_CURRENT_BINARY_DIR}/italc-master.rc
						DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/italc-master.rc)

ENDIF(ITALC_BUILD_WIN32)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
ADD_EXECUTABLE(italc-master ${master_UIC_out} ${master_SOURCES} ${master_INCLUDES} ${master_MOC_out} ${master_RCC_out} ${WINRC})
TARGET_LINK_LIBRARIES(italc-master italc-core)

INSTALL(TARGETS italc-master RUNTIME DESTINATION bin)

IF(ITALC_BUILD_WIN32)
	SET_TARGET_PROPERTIES(italc-master PROPERTIES LINK_FLAGS -mwindows)
ENDIF(ITALC_BUILD_WIN32)

